package com.sgz.androidlib.others.sample.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.android.sgzcommon.recycleview.BaseRecyclerviewAdapter;
import com.android.sgzcommon.recycleview.BaseViewHolder;
import com.sgz.androidlib.R;

import java.util.List;

import androidx.annotation.NonNull;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author sgz
 * @date 2021-02-20
 */
public class RecyclerViewDecorationAdapter extends BaseRecyclerviewAdapter<String, RecyclerViewDecorationAdapter.ViewHolder> {

    public RecyclerViewDecorationAdapter(Context context, List<String> items) {
        super(context, items);
    }

    @Override
    protected int getItemViewId(int viewType) {
        return R.layout.adapter_recyclerview_decoration;
    }

    @Override
    protected ViewHolder getViewHolder(int viewType, View itemView) {
        return new ViewHolder(itemView);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, int position, String s) {
        holder.mTvText.setText(s);
    }

    class ViewHolder extends BaseViewHolder {

        @BindView(R.id.tv_text)
        TextView mTvText;

        public ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
